#pragma once
class CSprite
{
	friend class CSpriteCanvas;
public:
	CSprite(void);
	~CSprite(void);

	BOOL IsVisible() {return m_bVisible;};
	int GetVisible() {return m_bVisible;};
	void SetVisible(int bVisible) {m_bVisible = bVisible;};

	int GetSpriteType() {return m_nSpriteType;}
	void SetSpriteType(int nSpriteType) {m_nSpriteType = nSpriteType;};

	int GetWidth() {return m_nWidth;};
	void SetWidth(int nWidth) {m_nWidth = nWidth;};

	int GetHeight() {return m_nHeight;};
	void SetHeight(int nHeight) {m_nHeight = nHeight;};

	int GetPosX() {return m_nCurPosX;};
	void SetPosX(int nPosX) { m_nCurPosX = nPosX; m_nDstPosX = nPosX;};

	int GetPosY() {return m_nCurPosY;};
	void SetPosY(int nPosY) {m_nCurPosY = nPosY; m_nDstPosY = nPosY;};

	CRect GetRect();
	void SetRect(CRect rc);

	void SetSpriteData(DWORD dwSpriteData) {m_dwSpriteData = dwSpriteData;};
	DWORD GetSpriteData() {return m_dwSpriteData;};

	BOOL IsMove();
	void SetPos(int nPosX, int nPosY);
	void PlayMove(int nDstPosX, int nDstPosy, int nTotalFrame, int nIntervalTime);
    void PlayFrame(int nTotalFrame, int nIntervalTime);
	void EndPlay();

	virtual void OnNextFrame();
	virtual void Render(CDC *pDC) = 0;
	virtual BOOL IsPause() {return FALSE;}
protected:
    BOOL m_bVisible;
	int m_nSpriteType;
	int m_nWidth;
	int m_nHeight;

	int m_nCurPosX;
	int m_nCurPosY;
	int m_nDstPosX;
	int m_nDstPosY;

	int m_nTotalFrame;
	int m_nCurFrame;
	int m_nIntervalTime;
	int m_nElapseTime;

	DWORD m_dwSpriteData;
};

